<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        /*
         使用Boolean()函数
           1.数字-->Boolean,除了NaN和0，其余的都是true
           2.字符串-->Boolean,除了空串，都是true
           3.null和undefined-->Boolean,都是flase
           4.对象-->Boolean,都是true
        */
    //    以下结果都是flase
       var a = NaN;
       a = Boolean(a);
       alert(a);
       var b = 0;
       b = Boolean(b);
       alert(b);

       var c = "";
       c = Boolean(c);
       alert(c);

       var d = null;
       d = Boolean(d);
       alert(d);

       var e = undefined;
       e = Boolean(e);
       alert(e);
    </script>
</head>
<body>
    
</body>
</html>